function TransVal(Type) {
 $SUMInvoices = document.TRANSProperties.SumValues.value;
	if ($SUMInvoices == 0) {
		alert('Transmissao sem valores.');
	} else {
		if (confirm('Pretende confirmar a transmissao?')==true) {
			subform('TRANSProperties','Subapp');
			document.TRANSProperties.PRSVCX.disabled=true;
		} 
	}
}
function AritmSUMValues(VALUE,QUANT) {
	$VALUE = document.getElementById(VALUE).value;
	$QUANT = document.getElementById(QUANT).value;
	document.TRProperties.SUMValues.value = (parseFloat(document.TRProperties.SUMValues.value)+($VALUE*$QUANT)).toFixed(2);
}
function AritmDEBValues(VALUE,QUANT) {
	$VALUE = document.getElementById(VALUE).value;
	$QUANT = document.getElementById(QUANT).value;
	document.TRProperties.SUMValues.value = (parseFloat(document.TRProperties.SUMValues.value)-($VALUE*$QUANT)).toFixed(2);
}
function AritmSUMValuesExc(VALUE,QUANT) {
	$VALUE = document.getElementById(VALUE).value;
	$QUANT = document.getElementById(QUANT).value;
	$SUM = parseFloat(document.ExchangeInvoice.SUMValues.value);
	document.ExchangeInvoice.SUMValues.value = ($SUM+($VALUE*$QUANT)).toFixed(2);
	document.ExchangeInvoice.TmpAmount.value = ($SUM+($VALUE*$QUANT)).toFixed(2);
	document.ExchangeInvoice.AritmContr.value = $QUANT;
	subform('ExchangeInvoice','Exc_registred');
}
function AritmDEBValuesExc(VALUE,QUANT) {
	$VALUE = document.getElementById(VALUE).value;
	$QUANT = document.getElementById(QUANT).value;
	$SUM = parseFloat(document.ExchangeInvoice.SUMValues.value);
	document.ExchangeInvoice.SUMValues.value = ($SUM-($VALUE*$QUANT)).toFixed(2);
	document.ExchangeInvoice.TmpAmount.value = ($SUM-($VALUE*$QUANT)).toFixed(2);
	document.ExchangeInvoice.AritmContr.value = $QUANT;
	subform('ExchangeInvoice','Exc_registred');
}
function confirm_proceed(msg) {
	if (confirm(msg)==true)
    return true;
	else
    return false;
}